#ifndef MODULEHPLCTIMEPROGRAM_H
#define MODULEHPLCTIMEPROGRAM_H

#include <QTimer>
#include "basemodule.h"
#include "modulehplctimeprogramdefine.h"
#include "hplctimeprogram.h"

class ModuleHplcTimeProgram : public BaseModule
{
    Q_OBJECT
public:
    ModuleHplcTimeProgram(QObject *parent = nullptr);
    virtual ~ModuleHplcTimeProgram() override;

    virtual bool setConfig(int id, QVariant &var) override;
    virtual bool getConfig(int id, QVariant &var) override;

    virtual bool setParam(int id, QVariant &var) override;
    virtual bool getParam(int id, QVariant &var) override;

signals:
    void injectProgramFinished();
    void rowChanged(int row);
    void loopTimesChanged(int loopTimes);
    void timeProgramFinished();
    void sampleTimeout();
    void totalRunTimeout();
    void statusChanged(PumpUnit status);

public slots:
    void onTimeout();
    virtual void onStart() override;

private:
    QTimer                  *m_timer = nullptr;

    HplcTimeProgram         *m_hplcTimeProgram;
};

#endif // MODULEHPLCTIMEPROGRAM_H
